package com.xnyzc.lhy.mis.controller.cmsapi.user;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.cms.OfficeParam;
import com.xnyzc.lhy.mis.service.cms.user.UserPermissionsService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户关联权限
 *
 * @Author: wangshuo
 * @Date: 2019-08-28 14:11
 */
@RestController
@RequestMapping("/cmsapi/userpermissions")
public class UserPermissionsController {

    @Autowired
    private UserPermissionsService userPermissionsService;

    /**
     * 用户关联权限列表
     *
     * @return
     */
    @ApiOperation(value = "用户关联权限列表", notes = "用户关联权限列表")
    @PostMapping(value = "/getUserPermissionsList")
    public Rv getUserPermissionsList(
            @ApiParam(name = "officeParam", value = "接入传参") @RequestBody OfficeParam param)
    {
        return Rv.wrap(userPermissionsService.getUserPermissionsList(param));
    }

    /**
     * 用户关联权限
     *
     * @return
     */
    @ApiOperation(value = "用户关联权限列表", notes = "用户关联权限列表")
    @PostMapping(value = "/getUserPermissionsSave")
    public Rv getUserPermissionsSave(
            @ApiParam(name = "officeParam", value = "接入传参") @RequestBody OfficeParam param)
    {
        return Rv.wrap(userPermissionsService.getUserPermissionsSave(param));
    }

}
